1. Field of the Invention
The present invention relates an image processing method, an image processing apparatus, a recording medium, and a computer program and, in particular, to an image processing method, an image processing apparatus for processing an image, a recording medium, and a computer program for performing gradation conversion responsive to a luminance variation from frame to frame in a moving image.
2. Description of the Related Art
A variety of gradation conversion methods have been proposed to compress a tonal gradation of image data captured by a solid-state image pickup device, such as a charge-coupled device (CCD), to present the image on a low-dynamic range on-screen media or print media to enhance contrast for attractive looking. For example, a histogram is produced from captured image data, a proper modification is applied to the histogram based on a maximum value and a minimum value of the histogram, and a representative value of the entire distribution of the data to produce a lookup table (LUT), and tonal gradation conversion is performed using the LUT (Japanese Unexamined Patent Application Publication No. 10-283470).
Known gradation conversion techniques are based on still images. The gradation conversion is performed with respect to both end-points of a luminance histogram of the image. If large variations take place in the histogram from frame to frame, the curve of the gradation conversion changes. The brightness level of the entire scene frequently changes, thereby making the scene aesthetically unpleasing.
For example, FIGS. 1A, 2A, and 3A show three consecutive frames, and FIGS. 1B, 2B, and 3B illustrate histograms of luminance values of the respective frames of FIGS. 1A, 2A, and 3A.
Captured image data on a per frame basis has a certain dynamic range. For convenience of explanation, the captured image data is an image 1 with the dynamic range thereof compressed into 8 bits.
The body of a plane represented by an object 21a of FIG. 2A, and an object 21b of FIG. 3A has the highest luminance in each frame, followed by a cloud 11 and the sky 12 in FIGS. 1A-3A. A roof 13 of a building has the lowest luminance.
The captured image data is subjected to a typical contrast enhancement process. For example, the top end and bottom end of a five-point histogram are assigned to a maximum luminance value and a minimum luminance value, respectively. In histograms of FIGS. 1B, 2B, and 3B, broken lines show that pixels are present within a width of the five-point histogram defined by the two broken lines. The range defined by the width corresponds to a dynamic range of an output image.
Since a range R1 of the histogram is assigned to the dynamic range as shown FIG. 1A, a high-contrast image output is expected. When the object 21a appears in the screen as shown in FIG. 2B, the histogram contains high frequency of occurrences of high luminance pixels. The dynamic range of luminance assigned to the output image thus extends. Since a white level is assigned to the highest luminance object 21a, the image of FIG. 1A is generally dark except the roof 13. The image of FIG. 1A appears to slightly lack contrast.
As shown in FIG. 3A, the object 21a shifts and appears as the object 21b. A high-luminance area is reduced, and the luminance dynamic range assigned to the output image is narrowed. For this reason, an image area other than the object 21b appears bright, presenting a slightly increased contrast.
If the result of gradation conversion shown in FIGS. 1A-3A is shown in a moving image, the brightness of the screen changes from frame to frame. Viewers feel as if the screen flickers. This is annoying to the users.
The problem involved in the gradation conversion has been discussed. To overcome this problem, stored gradation conversion results of a plurality of past frames and the result of a current frame may be averaged to ease sharp variations in scene luminance taking from frame to frame. However, requirements for computation performance and memory capacity become excessively high.